var ajaxHelper = require("../../utils/ajaxhelp");
const serviceUrl = getApp().globalData.serviceUrl;
let token = wx.getStorageSync('token');

//根据潜客Id获取预约信息
const QueryReservationByLeadId = (leadId,new_insurancetype) => {
	token = wx.getStorageSync('token');
	return ajaxHelper.promiseRequst(serviceUrl + "/api/Reservation/QueryReservationData", {
		'Authorization': 'Bearer ' + token
	}, "GET", {
		leadId:leadId,
		new_insurancetype:new_insurancetype,
	})
}

//根据潜客Id获取预约信息
const QueryReservationListByLeadId = (leadId,new_insurancetype) => {
	token = wx.getStorageSync('token');
	return ajaxHelper.promiseRequst(serviceUrl + "/api/Reservation/QueryReservationListByLeadId", {
		'Authorization': 'Bearer ' + token
	}, "GET", {
		leadId:leadId,
		new_insurancetype:new_insurancetype,
	})
}

//根据潜客Id获取预约信息
const QueryReservationByLeadIdAndScid = (leadId,ScId) => {
	token = wx.getStorageSync('token');
	return ajaxHelper.promiseRequst(serviceUrl + "/api/Reservation/QueryReservationByLeadIdAndScid", {
		'Authorization': 'Bearer ' + token
	}, "GET", {
		leadId:leadId,
		ScId:ScId,
	})
}
module.exports = {
	QueryReservationByLeadId,
	QueryReservationByLeadIdAndScid,
	QueryReservationListByLeadId,
}
